#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
@author: xjx
@time: 2023/11/1 19:37 
@file: update_driving_logistics.py
@project: nanchangproject
@describe: 运行函数更新某车的驾驶风格driving_mode和物流模式logistics_mode
"""
from utils.DrivingMode.driving_mode_model import DrivingModeInstance, DrivingModeUtil
from utils.LogisticsMode.logistics_mode_model import LogisticsModeInstance, LogisticsModeUtil

if __name__ == '__main__':
    d_instance = DrivingModeInstance(
        car_speed_mean=31.2,
        car_speed_sd=18.8,
        acceleration_sd=0.15,
        overspeed_proportion=0.20,
        rapid_acceleration_proportion=0.11,
        engine_speed_mean=1500,
        engine_speed_sd=400,
        car_number='',
        vin='LETYBCG20LH036233'
    )
    l_instance = LogisticsModeInstance(
        radius_of_gyration=0.32,
        daily_travel_location=8.8,
        motion_entropy=0.8,
        daily_driving_time=24300,
        daily_driving_distance=98,
        car_number='',
        vin='LETYBCG20LH036233'
    )
    d_fun = DrivingModeUtil()
    l_fun = LogisticsModeUtil()
    d_fun.driving_mode_recognition(instance=d_instance)
    d_fun.driving_mode_load_to_database(instance=d_instance)
    l_fun.logistics_mode_recognition(instance=l_instance)
    l_fun.logistics_mode_load_to_database(instance=l_instance)
